<?php 
use yii\helpers\Html;
use yii\helpers\Url;
 ?>
  <?php $this->beginPage() ?> 
<!DOCTYPE html>
<html>
<head>
	<title></title>
	 
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css">
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/js/materialize.min.js"></script>
  <!-- Compiled and minified JavaScript -->
  
<style type="text/css">
  .content {
 position: relative; 
 background: hsla(0,0%,100%,.1);
}
</style>
</head>
<?php $this->beginBody() ?> 
<body style="font-family:Microsoft YaHei;">
 
  <!--  parallax的设置-->
   <div class="parallax-container" id="pc" >
    <nav class="content">
      
        <div class="nav-wrapper">
      <div class="container">
        <ul class="left hide-on-med-and-down">

          <li class="active"><a href="<?= Url::to(['blog/article']) ?>">技术</a></li>
          <li><a href="<?= Url::to(['blog/live']) ?>">生活</a></li>
          <li ><a href="#">网站更新进度</a></li>

        </ul>
        <ul class="right hide-on-med-and-down">

       
          <li ><a href="#" onclick="window.location='<?php  echo Url::to(['admin/login']); ?>'">登录</a></li>
         
        </ul>
    </div>
      </div>
    </nav>
      <div class="parallax"><img src="/images/youname.png" id=background></div>
      <div style="margin-left: 10%;color: white;font-size: 40px" id="title"><div><?php echo $blogname ?></div><div style="font-size: 17px">&nbsp;<?php echo $intro ?></div></div>
    </div>
  <div class="section white">
    <div class="row container">
      
    <div class="col s8">
    	<!-- 数据#767676; -->
      <?php  
      echo Html::tag('div',$article->article_date.' 由 '.$author.' 编辑');
      echo Html::tag('div', $article->article_title,['style'=>['font-size'=>'30px']]);
      echo Html::tag('p', $article->article_content);
      ?>
        <div style="height: 80px"></div>
<table>
        <thead>
          <tr>
              <th >评论</th>
              
          </tr>
        </thead>

        <tbody>
          <?php
          if($comment_data!=null) {
          foreach ($comment_data as $key => $value) {
            
    
          echo "<tr>";
              echo "<td>";
                  echo "<div class=\"row\">";
                      echo "<div class=\"col s1\">";
                          echo Html::tag('img','',['src'=>'images/person.png','style'=>['width'=>'40px']]);
                      echo "</div>";
                      echo "<div class=\"col s11\">";
                          echo "<div>";
                              echo Html::tag('strong',$value->comment_name,['style'=>['color'=>'rgba(0,0,0,0.87)','font-weight'=>'bold','font-size'=>'12px']]);
                          echo "</div>";
                          echo Html::tag('div',$value->comment_date,['style'=>['color'=>'#767676']]);
                          echo Html::tag('p',$value->comment_content);
                      echo "</div>";
                  echo "</div>";
            echo "</td>";
          echo "</tr>"; 
        }
      }
           ?>
        
        </tbody>
      </table>

            <?php 
  echo Html::tag('p','发表评论',['style'=>['color'=>'rgba(0,0,0,0.87)','font-weight'=>'bold']]);
  
$form = \yii\bootstrap\ActiveForm::begin();
echo $form->field($comment,'comment_name')->textInput([]);
echo $form->field($comment,'comment_content')->textarea(['class'=>'materialize-textarea']);
echo \yii\bootstrap\Html::submitButton('提交',['class'=>'btn btn-info']);
\yii\bootstrap\ActiveForm::end(); 

             ?>
 
    </div>
       <div class="col s4">
          <div class="input-field">
                <!-- <i class="material-icons prefix"></i> -->
                <input id="icon_prefix" type="text" class="validate" placeholder="搜索？不存在的...(有空再写把=，=)">
                <label for="icon_prefix">search</label>
               </div>
               <table>
            <thead>
              <tr>
                  <th data-field="id">近期文章</th>                 
              </tr>
            </thead>
            <tbody>      
               <?php 
                 foreach($newArticle as $key=>$val){
                  $option1 =['href' =>Url::to(['blog/article','id'=>$val->id]),'style'=>'font-size:15px'];
                  echo "<tr>";
                   echo "<td>";                 
                   echo Html::tag('a', $val->article_title,$option1);
                   echo "</td>";
                   echo "</tr>";
                 }                        
                 ?>                                                             
            </tbody>
      </table>
    </div>	    
    </div>
  </div>
  <script type="text/javascript">
     $(document).ready(function(){
      $('.parallax').parallax();
    });     
   
var h=$(window).height();
var pc = document.getElementById("pc"); 
var b= document.getElementById("back"); 
var title= document.getElementById("title"); 
var textarea1= document.getElementById("textarea1"); 
title.style.marginTop = h*0.25-h*0.25*0.7+"px";
pc.style.height=h*0.25+"px";

// b.style.top=h-100+"px";
 </script>
 
  <?php $this->endBody() ?>
</body>
 
</html>
  <?php $this->endPage() ?>